<?php

include_once("playlist.class.php");
include_once("playlistMapper.class.php");
include_once("ID3.class.php");
include_once("ID3Mapper.class.php");

session_set_cookie_params(60*10);
session_name("Music");
session_start();

if (isset($_GET["remove_song"])) {
    $playlist_name = $_GET["name_playlist"];
    $song_id = $_GET["remove_song"];
    $userid = $_SESSION["userid"];
    $playlist = PlaylistMapper::findByUseridAndName($userid, $playlist_name);
    $id3 = ID3Mapper::findById($song_id);
    $playlist[0]->delete_song($id3->get_id());
}

?>
